<!-- 物业报修 -->
<template>
  <div class="repair">
    <ul class="repair_ul">
      <li>
        <div>缴费项目名称</div>
        <el-input type="text" v-model="name" placeholder="请输入缴费项目名称"></el-input>
      </li>
    </ul>

    <div class="repair_btn">
      <el-button type="primary" @click="upload">提交</el-button>
    </div>
  </div>
</template>

<script>
import { Notify } from 'vant'

export default {
  data() {
    return {
      name: '',
    }
  },

  methods: {
    upload() {
      if (this.name != '') {
        this.$axios
          .post('/property/pay/project/save', {
            name: this.name,
          })
          .then((res) => {
            if (res.data.code == 200) {
              Notify({ type: 'success', message: '提交成功！' })
              this.$emit('submitSucess')
            }
          })
          .catch(() => {})
      } else {
        Notify({ type: 'danger', message: '请填写名称' })
      }
    },
  },
}
</script>

<style scoped>
.repair_ul {
  padding: 3%;
  font-size: 0.42667rem;

  width: 100%;
}
.repair_ul > li > div:first-child {
  margin-bottom: 5px;
}
.repair_ul > li {
  margin-bottom: 10px;
}

/* 提交按钮 */
.repair_btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.headImg {
  width: 100%;

  margin-top: 46px;
}
</style>
